<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打分页面</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
    <script src="<%=request.getContextPath()%>/js/jquery.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
    <style>
        body {
            background-color: #f8f9fa;
        }
        .container {
            margin-top: 100px;
            max-width: 400px;
        }
        .input-group {
            margin-bottom: 15px;
        }
    </style>
</head>
<body>
    <div class="container">
        <form method="post" action="../activity_score" id="gradeform">
            <input type="hidden" name="note_id" value="${noteId}">
            <h2 class="text-center">请为该志愿者进行评分（区间 0 - 10）</h2>
            <div class="input-group">
                <input type="number" class="form-control" name="score" placeholder="输入分数" aria-label="Score" id="scoreInput" required>
            </div>
        </form>
        <button class="btn btn-primary btn-block" onclick="submitScore()">确认</button>
    </div>

    <script>
        function submitScore() {
            const score = document.getElementById('scoreInput').value;
            if (score >= 0 && score <= 10) {
                //alert('您输入的分数是: ' + score);
                $("#gradeform").submit();
            } else {
                alert('请输入有效的分数(区间 0 - 10)');
            }
        }
    </script>

</body>
</html>
